home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / ivars.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  6KB  |  143 lines

  1. #define INIT(v) =v 
  2.  
  3.  
  4. #include <stdlib.h>
  5. #include "config.h"
  6. #include "int.h"
  7.  
  8.  
  9.   int *stack_segments [MAX_TASKS]; /* one stack segment for each task */
  10.   int task_stackptr [MAX_TASKS];   /* stack pointers for task stacks */
  11.   unsigned int data_segments_dim;  /* dimension of data_segments */
  12.   int **data_segments;             /* one data segment for each cunit */
  13.   int *data_seglen;                /* length of data segments */
  14.   unsigned int code_segments_dim;  /* dimension of code_segments */
  15.   char **code_segments;            /* segments containing code */
  16.   int *code_seglen;                /* length of code segments */
  17.   int *cur_stack;                  /* current stack segment */
  18.   int cur_stackptr;                /* stack ptr for cur_stack */
  19.   char *cur_code;                  /* current code segment */
  20.   int num_cunits;                  /* number of compilation units */
  21.  
  22.  
  23.   int cs;       /* index of current code_segment in code_segments */
  24.   int ip;       /* instruction pointer in cur_code */
  25.   int sp;       /* stack pointer */
  26.   int sfp;      /* stack frame pointer */
  27.   int bfp;      /* block frame pointer */
  28.   int exr;      /* exception register */
  29.   int lin;      /* line number for tracing */
  30.  
  31.  
  32.   int tp;                /* index of current task in stack_segments */
  33.   int *heap_next;        /* top of heap for allocation */
  34.   int heap_base;         /* segment number of heap */
  35.   int *heap_addr;        /* address of beginning of heap */
  36.   long next_clock;        /* next time to call clock_interrupts */
  37.   long time_offset;       /* cumulative skipped time for simulated time */
  38.   int next_clock_flag;   /* request to check the clock (task waiting) */
  39.   int simul_time_flag;   /* run with simulated time (versus real time) */
  40.   int time_slicing_flag; /* time slicing (vs schedule at system call) */
  41.   long time_slice;        /* length of time slice (500 ms default) */
  42.   int tasking_trace;     /* TRUE to trace tasking */
  43.   int rendezvous_trace;  /* TRUE to trace rendezvous */
  44.   int debug_trace;       /* TRUE for general debugging trace */
  45.   int exception_trace;   /* TRUE to trace exceptions */
  46.   int call_trace;        /* TRUE to trace calls */
  47.   int line_trace;        /* TRUE to trace line numbers */
  48.   int instruction_trace; /* TRUE to trace instructions */
  49.   int context_sw_trace;  /* TRUE to trace context switches */
  50.   int rr_flag;           /* TRUE to allow round-robin scheduling */
  51.   int rr_counter;        /* counter of statements - round_robin scheme*/
  52.   int rr_nb_max_stmts;   /* max value of rr_counter. */
  53.  
  54.  
  55.   unsigned int data_slots_dim;      /* dimension of data_slots */
  56.   char **data_slots;
  57.   unsigned int code_slots_dim;      /* dimension of code_slots */
  58.   char **code_slots;
  59. #ifdef MONITOR
  60.   char **code_slots_file;
  61.   char **code_slots_package;
  62. #endif
  63.   unsigned int exception_slots_dim; /* dimension of exception_slots */
  64.   char **exception_slots;
  65.  
  66.  
  67.   int max_mem;                      /* size of a heap segment */
  68.   int w;                            /* used by GET_WORD */
  69.   struct tt_fx_range *temp_template;/* fixed point work template */
  70.  
  71.   int bse,bas1,bas2,bas3,bas4;      /* address base values */
  72.   int off,off1,off2,off3,off4;      /* address offset values */
  73.   int *ptr,*ptr1,*ptr2,*ptr3,*ptr4; /* memory addresses */
  74.   int value,val1,val2;              /* operands for int operations */
  75.   int length1,length2;              /* for array operations */
  76.   long lvalue,lval1,lval2;          /* operands for long operations */
  77.   long fval1,fval2,fvalue;          /* operands for fixed operations */
  78.   float rvalue,rval1,rval2;         /* operands for float operations */
  79.   int val_high,val_low;             /* low/high of INT range */
  80.   int result,delta;                 /* used in fixed point */
  81.   int size;                         /* size of object */
  82.   int attribute;                    /* attribute code */
  83.   int slot;                         /* for create structure */
  84.   int component_size;               /* size of array component */
  85.   long now_time;                     /* current time */
  86.   int to_type;                      /* type from template */
  87.   int discr_list[MAX_DISCR];        /* accumulate list of discriminants */
  88.   int nb,i;                         /* loop counters etc */
  89.   int overflow;                     /* overflow flag from arith routines */
  90.   int nb_discr;                     /* number of discriminants */
  91.   int nb_dim;                       /* dimension of array */
  92.   int ratio,power;                  /* used in attribute processing */
  93.   int d,n;                          /* temporaries */
  94.   int old_cs;                       /* old value of cs */
  95.   int jump;                         /* jump address */
  96.   int lim;                          /* limit in for loop */
  97.   struct bf *bfptr;                 /* pointer to block frame */
  98.   int *tfptr1,*tfptr2;              /* pointers to task frames */
  99.   int cur_col;                      /* temporary for predef */
  100.  
  101.   int break_point;       /* next break point */  
  102.  
  103.   int fix_val1[20];      /* fixed point intermediate values */
  104.   int fix_val2[20];     
  105.   int fix_resu[20];     
  106.   int fix_temp[20];     
  107.   int mul_fact[20];     
  108.   int div_fact[20];     
  109.  
  110.   int arith_overflow;
  111.   int sgn;
  112.   int last_task;
  113.   int *free_list INIT((int *)0);
  114.   int raise_cs;
  115.   int raise_lin;
  116.   char *raise_reason;
  117.  
  118.  
  119.  
  120.  
  121. #define MAXFILES 20
  122.   struct afcb *(afcbs[MAXFILES]);
  123.  
  124.  
  125.   int operation;         /* operation for predef. set in the main loop */
  126.   int data_exception;    /* exception to raise on data error */
  127.   int filenum;           /* number of current file */
  128.   int standard_in_file;  /* index of standard input file */
  129.   int standard_out_file; /* index of standard output file */
  130.   int current_in_file;   /* index of current default input file */
  131.   int current_out_file;  /* index of current default output file */
  132.   int current_in_file_saved;   
  133.   int current_out_file_saved;  
  134.   int file_offset;       /* Offset due to file argument in the stack */
  135.   struct tfile *tfiles;  /* linked list of temporary files */
  136.  
  137.  
  138.   char work_string[4096];
  139.  
  140.  
  141.   int main_task_size;
  142.   int new_task_size;
  143.